home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / fortran / toolpack.000 / toolpack / toolpack1.2 / scriptsource / statdoc.s < prev    next >
Encoding:
Text File  |  1993-10-04  |  4.0 KB  |  119 lines

  1. #! /bin/csh
  2. #  statdoc is a csh script to generate documentation information based
  3. #  on information in the symbol table of a Fortran program using ISTAL.
  4. #    (via the combined tool fragment ISTLY = ISTLX/ISTYP and then ISTAL)
  5. #
  6. #
  7. #  Invocation:
  8. #
  9. #  statdoc Fortran_source_file input_file output_file
  10. #
  11. #  Check command line validity.
  12. if ( $#argv < 3 ) then
  13. TOOLPACKPATH/toolpack1.2/util/echoerr \
  14. Invocation:
  15. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  16. TOOLPACKPATH/toolpack1.2/util/echoerr \
  17. statdoc Fortran_source_file input_file output_file
  18. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  19. TOOLPACKPATH/toolpack1.2/util/echoerr \
  20. input_file is a user-written template of a report that will be written
  21. TOOLPACKPATH/toolpack1.2/util/echoerr \
  22. as output_file.  input_file has the form of a document containing troff
  23. TOOLPACKPATH/toolpack1.2/util/echoerr \
  24. requests.  In the places in the document where information derived from
  25. TOOLPACKPATH/toolpack1.2/util/echoerr \
  26. the symbol table is to be inserted, the user writes a special request
  27. TOOLPACKPATH/toolpack1.2/util/echoerr \
  28. of the form '".al X"' where '"X"' indicates the information to be
  29. TOOLPACKPATH/toolpack1.2/util/echoerr \
  30. inserted.  Following are the acceptable values for X showing the
  31. TOOLPACKPATH/toolpack1.2/util/echoerr \
  32. nature of the information that will be inserted:
  33. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  34. TOOLPACKPATH/toolpack1.2/util/echoerr \
  35. '_CALL   A graph of the subroutine and function calls'
  36. TOOLPACKPATH/toolpack1.2/util/echoerr \
  37. '_X      A simple cross-reference summary of subroutine and function calls'
  38. TOOLPACKPATH/toolpack1.2/util/echoerr \
  39. '_F      A full cross-reference summary of subroutine and function calls'
  40. TOOLPACKPATH/toolpack1.2/util/echoerr \
  41. '_CO     A report of COMMON block usage'
  42. TOOLPACKPATH/toolpack1.2/util/echoerr \
  43. '_SY     A list of symbols and their attributes'
  44. TOOLPACKPATH/toolpack1.2/util/echoerr \
  45. '_W      Warning and error messages about anomolous constructions'
  46. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  47.    exit
  48. endif
  49. #  Check that Fortran_source_file exists.
  50. if ( -e $1 == 0 ) then
  51. TOOLPACKPATH/toolpack1.2/util/echoerr \
  52. "'$1' does not exist."
  53.    exit
  54. endif
  55. #  Check that input_file exists.
  56. if ( -e $2 == 0 ) then
  57. TOOLPACKPATH/toolpack1.2/util/echoerr \
  58. "'$2' does not exist."
  59.    exit
  60. endif
  61. #
  62. #  Create PFS.  If PFS already exists, exit with an advisory message.
  63. #
  64. if ( -e _.TOOLPACK == 0 ) then
  65.    mkdir _.TOOLPACK
  66. else
  67. TOOLPACKPATH/toolpack1.2/util/echoerr \
  68. Toolpack-created directory '"_.TOOLPACK"' exists. \
  69. Remove with script '"discard"'.
  70.    exit
  71. endif
  72. #  Make a tab-free copy of the Fortran source and use it as source.
  73. set src = ly.src$$
  74. expand $1 > _.TOOLPACK/$src
  75. #  Comment file name.
  76. set cmt = _.lycmt
  77. #  Parse tree file name.
  78. set tree = _.lytree
  79. #  Symbol table file name.
  80. #  Note: Symbol table file name must match that introduced by
  81. #  macro expansion into copy of input_file.
  82. set symb = _.ypsymb
  83. #  Comment index file name.
  84. set indx = _.lyindx
  85. #  Create the interprocess file IST.CMD and append parameters for ISTLY.
  86. TOOLPACKPATH/toolpack1.2/util/mkipf \
  87. $src $cmt $tree $symb $indx
  88. #
  89. #  Invoke ISTLY.
  90. #
  91. TOOLPACKPATH/toolpack1.2/exec/istly.u
  92. #  If tool terminated with errors, advise user to obtain listing.  Exit.
  93. if ( `cat _.TOOLPACK/_.info` == -1 ) then
  94. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  95. TOOLPACKPATH/toolpack1.2/util/echoerr \
  96. 'Errors detected.  Invoke script "getlst" to obtain a listing showing'
  97. TOOLPACKPATH/toolpack1.2/util/echoerr \
  98. statement and token numbers.
  99. TOOLPACKPATH/toolpack1.2/util/echoerr ""
  100.    /bin/rm -r _.TOOLPACK
  101.    exit
  102. endif
  103. #  Create the input file for ISTAL by prepending the macro definitions
  104. #  and file loading commands to input_file, and then expanding the macros.
  105. set repin = alin$$
  106. set scratch = scrch$$
  107. cat TOOLPACKPATH/toolpack1.2/util/Statdoc.Head $2 > _.TOOLPACK/$scratch
  108. m4 _.TOOLPACK/$scratch > _.TOOLPACK/$repin
  109. #  Create the interprocess file IST.CMD and append parameters for ISTAL.
  110. TOOLPACKPATH/toolpack1.2/util/mkipf \
  111. $repin \#$3
  112. #
  113. #  Invoke ISTAL.
  114. #
  115. TOOLPACKPATH/toolpack1.2/exec/istal.u
  116. #
  117. /bin/rm -r _.TOOLPACK
  118. #
  119.